from django.db import models
from management.models import BaseModel
# Create your models here.


# 群聊表
class GroupModel(BaseModel):
    name = models.CharField(verbose_name="群名", max_length=30)
    avatar_url = models.CharField(verbose_name="群聊头像", max_length=256, null=True, blank=True)
    staff_id = models.BigIntegerField(verbose_name="群主id")
    class Meta():
        db_table = "group_tb"
        verbose_name = "群聊表"
        verbose_name_plural = verbose_name
    def __str__(self):
        return self.name


# 群成员表
class GroupStaffModel(BaseModel):
    group_id = models.BigIntegerField(verbose_name="群聊id")
    staff_id = models.BigIntegerField(verbose_name="成员id")
    class Meta():
        db_table = "group_staff_tb"
        verbose_name = "群成员表"
        verbose_name_plural = verbose_name
    def __str__(self):
        return f"群聊{self.group_id}成员{self.staff_id}"